import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

/// api 请求状态：成功/失败。
class ApiStateProvider extends ChangeNotifier {
  static ApiStateProvider of(BuildContext context) => context.read<ApiStateProvider>();

  bool _isCommonEditionSuccess = true;
  /// 获取版本配置是否成功
  bool get isCommonEditionSuccess => _isCommonEditionSuccess;
  set isCommonEditionSuccess(bool newValue) {
    if (_isCommonEditionSuccess == newValue) {
      return;
    }

    _isCommonEditionSuccess = newValue;
  }

  bool get isCommonEditionFailed => !_isCommonEditionSuccess;
}